'use strict';

module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const AdminSchema = new Schema({
    nickName: { type: String },
    phone: { type: String },
    username: { type: String },
    password: { type: String  },
    role: { type: String, default: 'admin' },
    email: { type: String , default: '' },
    profile_image_url: { type: Array, default: []  },
    location: { type: String },
    signature: { type: String },
    profile: { type: String },
    avatarUrl: { type: String },
    is_block: { type: Boolean, default: false },
    country: { type: String  , default: '中国'},
    province: { type: String  , default: ''},
    city: { type: String , default: '' },
    area: { type: String , default: '' },
    address:{ type: String , default: ''},//地址
    language: { type: String },
    level: { type: Number, default: 4},
    servicesType: { type: String},  //服务类型
    des: { type: String, default: ''},
    wxcode: { type: String, default: ''}, //微信二维码
    linkman: { type: String, default: ''}, //联系人
    linkmanstatus: { type: String, default: ''}, //联系人身份
    qq: { type: String, default: ''}, //QQ


    
    create_at: { type: Date, default: Date.now },
    update_at: { type: Date, default: Date.now },


  });
  AdminSchema.index({ create_at: -1 });
  return mongoose.model('Admin', AdminSchema);
};
